/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.
 */
package td.domain;

import java.util.ArrayList;

import td.domain.util.StatisticalComparison;

import com.googlecode.objectify.annotation.Entity;
import com.googlecode.objectify.annotation.Ignore;

/**
 * A topic facilitates discussions. It usually belongs to a single category, but
 * adding other ones is possible.
 * 
 * @author Artem Shamsutdinov
 * 
 */
@Entity
public class Topic extends StatisticalGrouping {

	private static final long serialVersionUID = 3778275910840590249L;

	public static StatisticalComparison currentComparisonType = StatisticalComparison.NUMBER_OF_THOUGHT_READS;

	@Ignore
	public ArrayList<Category> categories = new ArrayList<Category>();

	public Topic() {
	}

	public Topic(String name) {
		this(name, null);
	}

	public Topic(String name, String description) {
		this.name = name;
		this.description = description;
	}

	public ArrayList<Category> getCategories() {
		return categories;
	}

	public void setCategories(ArrayList<Category> categories) {
		this.categories = categories;
	}

	@Override
	public StatisticalComparison getComparisonType() {
		return currentComparisonType;
	}

	/* (non-Javadoc)
	 * @see td.domain.StatisticalGrouping#getTypeForUrl()
	 */
	@Override
	public String getTypeForUrl() {
		return GroupType.TOPIC.name();
	}

}
